<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Class template any_member_hook</title>
<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../../intrusive/reference.html#header.boost.intrusive.any_hook_hpp" title="Header &lt;boost/intrusive/any_hook.hpp&gt;">
<link rel="prev" href="any_base_hook.html" title="Class template any_base_hook">
<link rel="next" href="any_to_avl_set_hook.html" title="Struct template any_to_avl_set_hook">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
<td align="center"><a href="../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="any_base_hook.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../intrusive/reference.html#header.boost.intrusive.any_hook_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="any_to_avl_set_hook.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.intrusive.any_member_hook"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template any_member_hook</span></h2>
<p>boost::intrusive::any_member_hook</p>
</div>
<h2 class="refsynopsisdiv-title">Synopsis</h2>
<div class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../intrusive/reference.html#header.boost.intrusive.any_hook_hpp" title="Header &lt;boost/intrusive/any_hook.hpp&gt;">boost/intrusive/any_hook.hpp</a>&gt;

</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="special">...</span> Options<span class="special">&gt;</span> 
<span class="keyword">class</span> <a class="link" href="any_member_hook.html" title="Class template any_member_hook">any_member_hook</a> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">make_any_member_hook</span><span class="special">::</span><span class="identifier">type</span> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
  <span class="comment">// <a class="link" href="any_member_hook.html#boost.intrusive.any_member_hookconstruct-copy-destruct">construct/copy/destruct</a></span>
  <a class="link" href="any_member_hook.html#idm19929-bb"><span class="identifier">any_member_hook</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <a class="link" href="any_member_hook.html#idm19937-bb"><span class="identifier">any_member_hook</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="any_member_hook.html" title="Class template any_member_hook">any_member_hook</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <a class="link" href="any_member_hook.html" title="Class template any_member_hook">any_member_hook</a> <span class="special">&amp;</span> <a class="link" href="any_member_hook.html#idm19951-bb"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="any_member_hook.html" title="Class template any_member_hook">any_member_hook</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <a class="link" href="any_member_hook.html#idm19965-bb"><span class="special">~</span><span class="identifier">any_member_hook</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="any_member_hook.html#idm19916-bb">public member functions</a></span>
  <span class="keyword">bool</span> <a class="link" href="any_member_hook.html#idm19917-bb"><span class="identifier">is_linked</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="id-1.3.18.42.2.4.4"></a><h2>Description</h2>
<p>Store this hook in a class to be inserted in an intrusive container.</p>
<p>The hook admits the following options: <code class="computeroutput">void_pointer&lt;&gt;</code> and <code class="computeroutput">link_mode&lt;&gt;</code>.</p>
<p><code class="computeroutput">link_mode&lt;&gt;</code> will specify the linking mode of the hook (<code class="computeroutput">normal_link</code> or <code class="computeroutput">safe_link</code>).</p>
<p><code class="computeroutput">void_pointer&lt;&gt;</code> is the pointer type that will be used internally in the hook and the container configured to use this hook. </p>
<div class="refsect2">
<a name="id-1.3.18.42.2.4.4.6"></a><h3>
<a name="boost.intrusive.any_member_hookconstruct-copy-destruct"></a><code class="computeroutput">any_member_hook</code> 
        public
       construct/copy/destruct</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><a name="idm19929-bb"></a><span class="identifier">any_member_hook</span><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: If <code class="computeroutput"><a class="link" href="link_mode.html" title="Struct template link_mode">link_mode</a></code> is or <code class="computeroutput">safe_link</code> initializes the node to an unlinked state.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
</li>
<li class="listitem">
<pre class="literallayout"><a name="idm19937-bb"></a><span class="identifier">any_member_hook</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="any_member_hook.html" title="Class template any_member_hook">any_member_hook</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: If <code class="computeroutput"><a class="link" href="link_mode.html" title="Struct template link_mode">link_mode</a></code> is or <code class="computeroutput">safe_link</code> initializes the node to an unlinked state. The argument is ignored.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
<p><span class="bold"><strong>Rationale</strong></span>: Providing a copy-constructor makes classes using the hook STL-compliant without forcing the user to do some additional work. <code class="computeroutput">swap</code> can be used to emulate move-semantics. </p>
</li>
<li class="listitem">
<pre class="literallayout"><a class="link" href="any_member_hook.html" title="Class template any_member_hook">any_member_hook</a> <span class="special">&amp;</span> <a name="idm19951-bb"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="any_member_hook.html" title="Class template any_member_hook">any_member_hook</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: Empty function. The argument is ignored.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
<p><span class="bold"><strong>Rationale</strong></span>: Providing an assignment operator makes classes using the hook STL-compliant without forcing the user to do some additional work. <code class="computeroutput">swap</code> can be used to emulate move-semantics. </p>
</li>
<li class="listitem">
<pre class="literallayout"><a name="idm19965-bb"></a><span class="special">~</span><span class="identifier">any_member_hook</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Effects</strong></span>: If <code class="computeroutput"><a class="link" href="link_mode.html" title="Struct template link_mode">link_mode</a></code> is <code class="computeroutput">normal_link</code>, the destructor does nothing (ie. no code is generated). If <code class="computeroutput"><a class="link" href="link_mode.html" title="Struct template link_mode">link_mode</a></code> is <code class="computeroutput">safe_link</code> and the object is stored in a container an assertion is raised.</p>
<p><span class="bold"><strong>Throws</strong></span>: Nothing. </p>
</li>
</ol></div>
</div>
<div class="refsect2">
<a name="id-1.3.18.42.2.4.4.7"></a><h3>
<a name="idm19916-bb"></a><code class="computeroutput">any_member_hook</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
<pre class="literallayout"><span class="keyword">bool</span> <a name="idm19917-bb"></a><span class="identifier">is_linked</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Precondition</strong></span>: <code class="computeroutput"><a class="link" href="link_mode.html" title="Struct template link_mode">link_mode</a></code> must be <code class="computeroutput">safe_link</code>.</p>
<p><span class="bold"><strong>Returns</strong></span>: true, if the node belongs to a container, false otherwise. This function can be used to test whether <code class="computeroutput">container::iterator_to</code> will return a valid iterator.</p>
<p><span class="bold"><strong>Complexity</strong></span>: Constant </p>
</li></ol></div>
</div>
</div>
</div>
<div class="copyright-footer">Copyright © 2005 Olaf Krzikalla<br>Copyright © 2006-2015 Ion Gaztanaga<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
      </p>
</div>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="any_base_hook.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../intrusive/reference.html#header.boost.intrusive.any_hook_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="any_to_avl_set_hook.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
